package bit_operation;

public class getSum {
    public int getSum(int a, int b) {

        while (b != 0) {
            // 无进位相加
            int x = a ^ b;
            // 进位
            int y = (a & b) << 1;
            a = x;
            b = y;
        }
        return a;

    }
}
